import type { Brand, Good } from "@/types/homeTypes/homeTypes.ts";

export interface GoodDetail {
   collectCount: number;
   commentCount: number;
   desc: string;
   discount: number;
   evaluationInfo: null;
   id: string;
   inventory: number;
   isCollect: null;
   isPreSale: boolean;
   mainPictures: string[];
   mainVideos: any[];
   name: string;
   oldPrice: string;
   price: string;
   recommends: null;
   salesCount: number;
   spuCode: string;
   userAddresses: null | UserAddress[];
   videoScale: number;
   brand: Brand;
   details: {
      pictures: string[]
      properties: PropertieValue[]
   };
   hotByDay: HotByDay[];
   similarProducts: SimilarProduct[];
   skus: Sku[];
   specs: Spec[];
   categories: Categorie[];
}

export interface PropertieValue {
   name: string,
   value: string
}

export interface HotByDay extends Good {
}

export interface SimilarProduct extends Good {

}

export interface Sku {
   id: string;
   inventory: number;
   oldPrice: string;
   picture: string;
   price: string;
   skuCode: string;
   specs: {
      name: string
      valueName: string
   }[];
}

export interface Spec {
   id: string;
   name: string;
   values: SpecValue[];
}

export interface SpecValue {
   desc: string;
   name: string;
   picture: string | null;
   select?: boolean;
   disabled?: boolean;
}

export interface Categorie {
   id: string
   layer: number
   name: string,
   parent: Categorie | null
}

export interface UserAddress {
   address: string;
   addressTags: string;
   cityCode: string;
   contact: string;
   countyCode: string;
   fullLocation: string;
   id: string;
   isDefault: number;
   postalCode: string;
   provinceCode: string;
   receiver: string;
}

export interface selectSku {
   inventory: number;
   oldPrice: string;
   price: string;
   skuId: string;
   specsText: string;
}


export const HotType = {
   "1": "24小时热榜",
   "2": "周榜",
   "3": "总榜",
};


export interface CommentInfo {
   evaluateCount: number;
   hasPictureCount: number;
   praisePercent: string;
   salesCount: number;
   tags: Tag[];
}

export interface Tag {
   title: string;
   tagCount: number;
}


export interface CommentPageParams {
   page: number;
   pageSize: number;
   hasPicture: boolean;
   tag: string | null;
   sortField: string | null;
   sortMethod: string;
}


export interface Comment {
   counts: number;
   page: number | string;
   pageSize: number;
   pages: number;
   items: CommentItem[];
}

export interface CommentItem {
   content: string;
   createTime: string;
   id: number;
   member: {
      avatar: string
      id: string
      nickname: string
   };
   orderInfo: {
      createTime: string
      quantity: number
      spces: { name: string, nameValue: string }
   };
   officialReply: string;
   pictures: any[];
   praiseCount: number;
   score: number;
   tags: string[];
}
